import request from "@/utils/request";

export function getMenuPage(data: Common.PaginationParams) {
  return request<{
    list: Menu.Item[];
    pagination: Common.Pagination;
  }>({
    url: "/admin/base/sys/menu/page",
    method: "POST",
    data,
  });
}

export function getMenuList() {
  return request<Menu.Item[]>({
    url: "/admin/base/sys/menu/list",
    method: "POST",
  });
}

export function addMenu(data: unknown) {
  return request<Menu.Item[]>({
    url: "/admin/base/sys/menu/add",
    method: "POST",
    data,
  });
}

export function updateMenu(data: unknown) {
  return request<Menu.Item[]>({
    url: "/admin/base/sys/menu/update",
    method: "POST",
    data,
  });
}

export function deleteMenu(data: unknown) {
  return request<Menu.Item[]>({
    url: "/admin/base/sys/menu/delete",
    method: "POST",
    data,
  });
}
